home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group03a.txt
/
000065_icon-group-sender_Fri Mar 28 12:34:33 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2003-12-22
|
4KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2SJYIQ24540
for icon-group-addresses; Fri, 28 Mar 2003 12:34:18 -0700 (MST)
Message-Id: <200303281934.h2SJYIQ24540@baskerville.CS.Arizona.EDU>
From: voice_of_reason@australia.edu (Quiet Voice)
X-Newsgroups: comp.lang.icon
Subject: Re: Befuddled by logic and an error message.....
Date: 28 Mar 2003 07:46:07 -0800
X-Complaints-To: groups-abuse@google.com
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
A follow-up to my own post based on some e:mail I recieved....
>Are you running on Windows or UNIX...on NT4SP6a with
>Icon 9.3.2 I get this:
>
>Run-time error 214
>File io.icn; Line 4
>input/output error
>offending value: 68
>Traceback:
> main()
> write(file(x),68) from line 4 in io.icn
>
I am running under Win 2000 with version 9.3.2.....and that is
precisely the error message I get.
>
>But I've got a broader question: Why is the temp file necessary?
I use the temp file because the editting process is iterative.
What I mean is that the program reads in the original file, writes it
over to a temporary holding file and offers the user a chance to edit
the file, observe the results and re-edit...over and over...until he
is satisfied. Each time, the program outputs the original file along
side the most recent edits.
Once satisfied, the program writes out the final version of the temp
file as the "answer".
voice_of_reason@australia.edu (Quiet Voice) wrote in message news:<9428c6a7.0303271418.6dd64a38@posting.google.com>...
> Greetings:
>
> Still in my endeavor to "re-learn" ICON, I have hit upon a bug that is
> partially a logic bug and partially a runtime error.
>
> What I am attempting to do is as follows --
>
> A file is opened which contains text.
>
> The idea of the program is to allow the user to selectively and
> iteratively edit and re-edit the file and see the edits alongside the
> original version of text.
>
> The program creates and output file that holds the original text and
> the current state of editing.
>
> A line from the original file along with the corresponding edited line
> are written to output.
>
> With each pass thru the loop the idea is that the program opens a temp
> file that holds the current editing. The user is essentially
> iteratively editing the temp file.
>
> Here's the code fragment along with comments I've written to
> myself....
>
> target := current text
> edit := proposed edits
> .
> .
> .
>
> # LOGIC PROBLEM WITH THIS LOOP. NEED TO READ DATA FROM CURRENT GUESS
> *THEN* SAVE NEW GUESS FOR
> # FUTURE READ....but NEED TO PREVENT "INFINTIE LOOP" SITUATION OF
> READING THEN WRITING THEN READING>>>>ETC
>
> # CURRENT VERSION RESULTS IN RUN-TIME ERROR: 214 (???) in line 88
>
> while (line := read(temp_holder)) do
> {
> orig := read(orig_text)
> trial_line := map(line,target,edit)
>
> write(output,"original: ",orig)
> write(output," ")
> write(output,"new: ",trial_line)
> write(output," ")
>
> OFFENDING LINE OF CODE ==> write(temp_holder,trial_line) # save
> current trial set
> }
>
> write("TRIAL CORRECTIONS WRITTEN TO TEMPORARY FILE.")
> writes("Do you have more corrections? Type yes or no: ")
> more := read()
>
> } #end INPUT loop
>
>
> ---
> First of all, what sort of situations create a runtime error 214? What
> am I doing wrong?
>
> Secondly, any suggestions on how better to accomplish this?
>
> Thanks for the advice and assitance.....